<link href="<?php echo base_url()?>common/css/public.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="<?php echo base_url()?>common/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="<?php echo base_url()?>common/kindeditor/themes/default/default.css" />
<script type="text/javascript" src="<?php echo base_url()?>common/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/layer/layer.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/jquery.form.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/jquery.validate.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/jquery.metadata.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/jquery.validate.messages_cn.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/validate.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/additional-methods.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/validateForm.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/jquery.Msg.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/MyJs.js"></script>

<script src="<?php echo base_url()?>common/kindeditor/kindeditor.js"></script>
<script src="<?php echo base_url()?>common/kindeditor/lang/zh_CN.js"></script>


<script>
    $(function () {
        var index = parent.layer.getFrameIndex(window.name);
        $(".not").click(function () {
            parent.layer.close(index);
        });
    })
    KindEditor.ready(function (K) {
        var editor = K.editor({
            uploadJson: '/common/kindeditor/php/upload_json.php',
            allowFileManager: true
        });
        function initimg() {
            editor.loadPlugin('image', function () {
                editor.plugin.imageDialog({
                    imageUrl: K('#url1').val(),
                    clickFn: function (url, title, width, height, border, align) {
                        K('#imgurl').val(url);
                        K('#img_tag').attr('src', url);
                        editor.hideDialog();
                    }
                });
            });
        }
        K('#img_tag').click(function () {
            initimg();
        });
        K('#imgurl').dblclick(function () {
            initimg();
        });
    });
    function Success(data) {
        parent.Success(data);

    }
    $(function () {
        $.validate_banner('ajax_form');
    });
</script>
<div id="dcMain" style="margin-left:0;padding-top:10px;">
    <!-- 当前位置 -->
    <div id="manager" class="mainBox" style="padding-top:0;">

        <form id="ajax_form" method="post" action="<?php echo site_url('admin/banner/edit_banner')?>?returnurl=<?php echo $backurl?>">
            <input type="hidden" value="<?php echo $bannerModel->bid?>" name="bid" />
            <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
                <tr>
                    <td width="100" align="right">banner图片</td>
                    <td>
                        <img id="img_tag" src="<?php echo $bannerModel->imgurl?>" onerror="this.src='<?php echo base_url('common')?>/images/nopic.png'" style="height:100px;width:100px;cursor:pointer;" />
                        <input type="text" id="imgurl" name="imgurl" size="40" class="inpMain" required type="url" value="<?php echo $bannerModel->imgurl?>" readonly="readonly" />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">权重</td>
                    <td>
                        <input type="text" name="weight" id="weight" size="40" class="inpMain " isZipCode value="<?php echo $bannerModel->weight?>" />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">启用</td>
                    <td>
                        <select id="isuse" name="isuse">
                            <option value="1" <?php echo $bannerModel->weight==1?'selected="selected"':''?>>启用</option>
                            <option value="0" <?php echo $bannerModel->weight==0?'selected="selected"':''?>>禁用</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <input type="submit" class="btn" value="修改" />
                        <input name="button" class="btn not" type="button" value="取消">
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
